class Solution {
public:
    vector<string> findRepeatedDnaSequences(string s) {
        vector<string> ret;
        int len = s.length();
        if (len <= 10) {
            return ret;
        }

        map<string, int> strMap;
        for (int start = 0; start + 9 < len; start++) {
            string strCur = s.substr(start, 10);
            if (strMap.count(strCur) && strMap[strCur] == 1) {
                ret.push_back(strCur);
            }
            strMap[strCur]++;
        }
        return ret;
    }
};